const http = require('node:http');

const req = http.request('http://www.bhu.edu.cn', (res) => {
  let chunks = [];
  res.on('data', (chunk) => {
    chunks.push(chunk);
  });
  res.on('end', () => {
    console.log('response:', Buffer.concat(chunks).toString('utf-8'));
  });
});

req.on('error', (e) => {
  console.error(`problem with request: ${e.message}`);
});

req.end();